Optimal. Leaf size=119 \[ a^2 x+\frac {3 a^2 \tanh ^{-1}(\sin (c+d x))}{4 d}-\frac {a^2 \tan (c+d x)}{d}-\frac {3 a^2 \sec (c+d x) \tan (c+d x)}{4 d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan ^3(c+d x)}{2 d}+\frac {a^2 \tan ^5(c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 119, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3971, 3554, 8,
2691, 3855, 2687, 30} \begin {gather*} \frac {a^2 \tan ^5(c+d x)}{5 d}+\frac {a^2 \tan ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}+\frac {3 a^2 \tanh ^{-1}(\sin (c+d x))}{4 d}+\frac {a^2 \tan ^3(c+d x) \sec (c+d x)}{2 d}-\frac {3 a^2 \tan (c+d x) \sec (c+d x)}{4 d}+a^2 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2687
Rule 2691
Rule 3554
Rule 3855
Rule 3971
Rubi steps
\begin {align*} \int (a+a \sec (c+d x))^2 \tan ^4(c+d x) \, dx &=\int \left (a^2 \tan ^4(c+d x)+2 a^2 \sec (c+d x) \tan ^4(c+d x)+a^2 \sec ^2(c+d x) \tan ^4(c+d x)\right ) \, dx\\ &=a^2 \int \tan ^4(c+d x) \, dx+a^2 \int \sec ^2(c+d x) \tan ^4(c+d x) \, dx+\left (2 a^2\right ) \int \sec (c+d x) \tan ^4(c+d x) \, dx\\ &=\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan ^3(c+d x)}{2 d}-a^2 \int \tan ^2(c+d x) \, dx-\frac {1}{2} \left (3 a^2\right ) \int \sec (c+d x) \tan ^2(c+d x) \, dx+\frac {a^2 \text {Subst}\left (\int x^4 \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {a^2 \tan (c+d x)}{d}-\frac {3 a^2 \sec (c+d x) \tan (c+d x)}{4 d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan ^3(c+d x)}{2 d}+\frac {a^2 \tan ^5(c+d x)}{5 d}+\frac {1}{4} \left (3 a^2\right ) \int \sec (c+d x) \, dx+a^2 \int 1 \, dx\\ &=a^2 x+\frac {3 a^2 \tanh ^{-1}(\sin (c+d x))}{4 d}-\frac {a^2 \tan (c+d x)}{d}-\frac {3 a^2 \sec (c+d x) \tan (c+d x)}{4 d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan ^3(c+d x)}{2 d}+\frac {a^2 \tan ^5(c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(558\) vs. \(2(119)=238\).
time = 5.69, size = 558, normalized size = 4.69 \begin {gather*} \frac {1}{960} a^2 (1+\cos (c+d x))^2 \sec ^4\left (\frac {1}{2} (c+d x)\right ) \left (240 x-\frac {180 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {180 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}-\frac {\left (293 \cos \left (\frac {d x}{2}\right )+333 \cos \left (2 c+\frac {3 d x}{2}\right )+287 \cos \left (2 c+\frac {5 d x}{2}\right )+67 \cos \left (4 c+\frac {7 d x}{2}\right )+68 \cos \left (4 c+\frac {9 d x}{2}\right )\right ) \sec (c) \sec ^5(c+d x) \sin \left (\frac {d x}{2}\right )}{2 d}-\frac {24 \sin \left (\frac {c}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}+\frac {149 \sin \left (\frac {c}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {24 \sin \left (\frac {c}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}+\frac {149 \sin \left (\frac {c}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {\cos \left (\frac {c}{2}\right ) \left (\frac {36}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}-\frac {151}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {36}{\left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}+\frac {151}{\left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}\right )}{d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 130, normalized size = 1.09
method | result | size |
derivativedivides | \(\frac {\frac {a^{2} \left (\sin ^{5}\left (d x +c \right )\right )}{5 \cos \left (d x +c \right )^{5}}+2 a^{2} \left (\frac {\sin ^{5}\left (d x +c \right )}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin ^{5}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{2}}-\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+a^{2} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) | \(130\) |
default | \(\frac {\frac {a^{2} \left (\sin ^{5}\left (d x +c \right )\right )}{5 \cos \left (d x +c \right )^{5}}+2 a^{2} \left (\frac {\sin ^{5}\left (d x +c \right )}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin ^{5}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{2}}-\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+a^{2} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+d x +c \right )}{d}\) | \(130\) |
risch | \(a^{2} x +\frac {i a^{2} \left (75 \,{\mathrm e}^{9 i \left (d x +c \right )}-60 \,{\mathrm e}^{8 i \left (d x +c \right )}+30 \,{\mathrm e}^{7 i \left (d x +c \right )}-360 \,{\mathrm e}^{6 i \left (d x +c \right )}-320 \,{\mathrm e}^{4 i \left (d x +c \right )}-30 \,{\mathrm e}^{3 i \left (d x +c \right )}-280 \,{\mathrm e}^{2 i \left (d x +c \right )}-75 \,{\mathrm e}^{i \left (d x +c \right )}-68\right )}{30 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{4 d}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{4 d}\) | \(161\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 119, normalized size = 1.00 \begin {gather*} \frac {24 \, a^{2} \tan \left (d x + c\right )^{5} + 40 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a^{2} + 15 \, a^{2} {\left (\frac {2 \, {\left (5 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.86, size = 139, normalized size = 1.17 \begin {gather*} \frac {120 \, a^{2} d x \cos \left (d x + c\right )^{5} + 45 \, a^{2} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 45 \, a^{2} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (68 \, a^{2} \cos \left (d x + c\right )^{4} + 75 \, a^{2} \cos \left (d x + c\right )^{3} + 4 \, a^{2} \cos \left (d x + c\right )^{2} - 30 \, a^{2} \cos \left (d x + c\right ) - 12 \, a^{2}\right )} \sin \left (d x + c\right )}{120 \, d \cos \left (d x + c\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int 2 \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \tan ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \tan ^{4}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.24, size = 148, normalized size = 1.24 \begin {gather*} \frac {60 \, {\left (d x + c\right )} a^{2} + 45 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 45 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 110 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 328 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 530 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.95, size = 174, normalized size = 1.46 \begin {gather*} a^2\,x+\frac {3\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d}+\frac {\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{2}-\frac {11\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{3}+\frac {164\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{15}-\frac {53\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {7\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________